home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 21 / Cream of the Crop 21 (Terry Blount) (October 1996).iso / bbs / pad311.zip / INIT.MEX < prev    next >
Text File  |  1996-07-16  |  2KB  |  67 lines

  1. // This Mex script initializes Padlock. First, it deletes any temporary files
  2. // which may still be lying around from a previous run. Then, it verifies
  3. // the existance of all the Padlock files.
  4.  
  5. #ifndef __MAX_MH
  6. #include <max.mh>
  7. #define __MAX_MH
  8. #endif
  9.  
  10. #ifndef __SETTINGS_MH
  11. #include "settings.mh"
  12. #endif
  13.  
  14. // Subroutines --------------------------------------------------------
  15.  
  16. void checkFile (string: filename) {
  17.   if (filename = "") return;
  18.   if (fileexists (filename) = False) {
  19.     log (str_missing_file_log + filename);
  20.     print (str_missing_file + filename);
  21.     print (str_report_to_sysop);
  22.     }
  23.   }
  24.  
  25. void checkBBSFile (string: filename) {
  26.   if (filename = "") return;
  27.   checkFile (message_file_directory + "\\" + filename + ".BBS");
  28.   vidsync ();
  29.   }
  30.  
  31. // Main routine ----------------------------------------------------------
  32.  
  33. int main () {
  34.  
  35.   // Delete temporary files
  36.  
  37.   remove (phoneTempFile);
  38.   remove (checkNumTempFile);
  39.  
  40.   // Check for the existance of miscellaneous input files
  41.  
  42.   checkFile (phone_file);
  43.  
  44.   // Check for the existance of all required .BBS files
  45.  
  46.   checkBBSFile (long_distance_file);
  47.   checkBBSFile (dupe_found_file);
  48.   checkBBSFile (lockout_file);
  49.   checkBBSFile (local_file);
  50.   checkBBSFile (ld_ok_file);
  51.   checkBBSFile (success_file);
  52.   checkBBSFile (welcome_back_file);
  53.   checkBBSFile (bad_code_file);
  54.   checkBBSFile (bad_password_file);
  55.   checkBBSFile (fail_file);
  56.   checkBBSFile (bad_time_file);
  57.   checkBBSFile (hangup_ld_file);
  58.   checkBBSFile (success_hangup_file);
  59.   checkBBSFile (help_file);
  60.   checkBBSFile (bad_baudrate_file);
  61.   checkBBSFile (bad_baudrate_attempt_file);
  62.   checkBBSFile (abort_file);
  63.  
  64.   return 0;
  65.   }
  66.  
  67.